package com.ayoka.parenting.bean;

import android.text.TextUtils;

import java.io.Serializable;
import java.util.List;

/**
 * @ProjectName: AyokaClient.
 * @ClassName: TopicBean.
 * @Description: .
 * @Author: jincp.
 * @CreateDate: 2019/11/11 13:59.
 */

public class TopicBean implements Serializable{

    public final static String TYPE_URL = "URL";
    public final static String TYPE_IMAGE = "IMAGE";
    public final static String TYPE_VIDEO = "VIDEO";
    public final static String TYPE_AUDIO = "AUDIO";


    public String Id;
    public String GroupID;
    public String Uid;
    public BasicUserInfoBean UserInfo;
    public String Content;
    public List<ImageBean> Images;
    public String Sound;
    public long SoundDuration;
    public int LikeCount;
    public int CommentCount;
    public int IsTop;
    public int IsLike;
    public String CreateDate;
    public String LastUpdate;
    public List<CommentBean> Comments;

    public boolean isExpanded;

    // 内容类型
    public String getType(){
        if (!TextUtils.isEmpty(Sound)){
            return TYPE_AUDIO;
        } else if (Images != null && !Images.isEmpty()){
            return TYPE_IMAGE;
        }
        return "";
    }


    public static boolean isCircleGroupOwnerId(String  circleGroupOwnerId) {
        return TextUtils.equals(UserManager.getInstance().uid, circleGroupOwnerId);
    }

    public static boolean isTopicOwner(String topicOwnerId) {
        return TextUtils.equals(UserManager.getInstance().uid, topicOwnerId);
    }
}
